package cn.stylefeng.guns.modular.api.model;

import java.util.List;

public class PageVo {
	
	public PageVo() {};
	
	public PageVo(int skip, int pageSize, int total, List<?> dataList) {
		this.skip = skip;
		this.pageSize = pageSize;
		this.total = total;
		this.dataList = dataList;
	};
	
	//当前页数
	private int skip = 1;
	//一页包含的记录数
	private int pageSize = 20;
	//总记录数
	private int total = 0;
	//数据列表
	private List<?> dataList;
	//是否有下一页
	private boolean hasNext;
	//是否有上一页
	private boolean hasPre;
	
	public int getSkip() {
		return skip;
	}

	public void setSkip(int skip) {
		this.skip = skip;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public List<?> getDataList() {
		return dataList;
	}

	public void setDataList(List<?> dataList) {
		this.dataList = dataList;
	}

	public boolean isHasNext() {
		this.hasNext = total > this.skip*this.pageSize;
		return this.hasNext;
	}

	public void setHasNext(boolean hasNext) {
		this.hasNext = hasNext;
	}

	public boolean isHasPre() {
		this.hasPre = this.skip > 1;
		return hasPre;
	}

	public void setHasPre(boolean hasPre) {
		this.hasPre = hasPre;
	}
	
}
